(0) Obligation:

Clauses:

div(X, Y, Z) :- quot(X, Y, Y, Z).
quot(0, s(Y), s(Z), R) :- ','(!, eq(R, 0)).
quot(X, 0, Z, U) :- ','(!, ','(eq(Z, s(X1)), ','(p(U, P), quot(X, Z, Z, P)))).
quot(s(X), Y, Z, U) :- ','(p(Y, P), quot(X, P, Z, U)).
p(0, 0).
p(s(X), X).
eq(X, X).

Query: div(g,g,a)

(1) CutEliminatorProof (SOUND transformation)

Eliminated all cuts by simply ignoring them[PROLOG].

(2) Obligation:

Clauses:

div(X, Y, Z) :- quot(X, Y, Y, Z).
quot(0, s(Y), s(Z), R) :- eq(R, 0).
quot(X, 0, Z, U) :- ','(eq(Z, s(X1)), ','(p(U, P), quot(X, Z, Z, P))).
quot(s(X), Y, Z, U) :- ','(p(Y, P), quot(X, P, Z, U)).
p(0, 0).
p(s(X), X).
eq(X, X).

Query: div(g,g,a)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
div_in: (b,b,f)
quot_in: (b,b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

div_in_gga(X, Y, Z) → U1_gga(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
quot_in_ggga(0, s(Y), s(Z), R) → U2_ggga(Y, Z, R, eq_in_ag(R, 0))
eq_in_ag(X, X) → eq_out_ag(X, X)
U2_ggga(Y, Z, R, eq_out_ag(R, 0)) → quot_out_ggga(0, s(Y), s(Z), R)
quot_in_ggga(X, 0, Z, U) → U3_ggga(X, Z, U, eq_in_ga(Z, s(X1)))
eq_in_ga(X, X) → eq_out_ga(X, X)
U3_ggga(X, Z, U, eq_out_ga(Z, s(X1))) → U4_ggga(X, Z, U, p_in_aa(U, P))
p_in_aa(0, 0) → p_out_aa(0, 0)
p_in_aa(s(X), X) → p_out_aa(s(X), X)
U4_ggga(X, Z, U, p_out_aa(U, P)) → U5_ggga(X, Z, U, quot_in_ggga(X, Z, Z, P))
quot_in_ggga(s(X), Y, Z, U) → U6_ggga(X, Y, Z, U, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U6_ggga(X, Y, Z, U, p_out_ga(Y, P)) → U7_ggga(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U7_ggga(X, Y, Z, U, quot_out_ggga(X, P, Z, U)) → quot_out_ggga(s(X), Y, Z, U)
U5_ggga(X, Z, U, quot_out_ggga(X, Z, Z, P)) → quot_out_ggga(X, 0, Z, U)
U1_gga(X, Y, Z, quot_out_ggga(X, Y, Y, Z)) → div_out_gga(X, Y, Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
quot_in_ggga(x1, x2, x3, x4)  =  quot_in_ggga(x1, x2, x3)
0  =  0
s(x1)  =  s(x1)
U2_ggga(x1, x2, x3, x4)  =  U2_ggga(x1, x2, x4)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
quot_out_ggga(x1, x2, x3, x4)  =  quot_out_ggga(x1, x2, x3)
U3_ggga(x1, x2, x3, x4)  =  U3_ggga(x1, x2, x4)
eq_in_ga(x1, x2)  =  eq_in_ga(x1)
eq_out_ga(x1, x2)  =  eq_out_ga(x1, x2)
U4_ggga(x1, x2, x3, x4)  =  U4_ggga(x1, x2, x4)
p_in_aa(x1, x2)  =  p_in_aa
p_out_aa(x1, x2)  =  p_out_aa
U5_ggga(x1, x2, x3, x4)  =  U5_ggga(x1, x2, x4)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U7_ggga(x1, x2, x3, x4, x5)  =  U7_ggga(x1, x2, x3, x5)
div_out_gga(x1, x2, x3)  =  div_out_gga(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

div_in_gga(X, Y, Z) → U1_gga(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
quot_in_ggga(0, s(Y), s(Z), R) → U2_ggga(Y, Z, R, eq_in_ag(R, 0))
eq_in_ag(X, X) → eq_out_ag(X, X)
U2_ggga(Y, Z, R, eq_out_ag(R, 0)) → quot_out_ggga(0, s(Y), s(Z), R)
quot_in_ggga(X, 0, Z, U) → U3_ggga(X, Z, U, eq_in_ga(Z, s(X1)))
eq_in_ga(X, X) → eq_out_ga(X, X)
U3_ggga(X, Z, U, eq_out_ga(Z, s(X1))) → U4_ggga(X, Z, U, p_in_aa(U, P))
p_in_aa(0, 0) → p_out_aa(0, 0)
p_in_aa(s(X), X) → p_out_aa(s(X), X)
U4_ggga(X, Z, U, p_out_aa(U, P)) → U5_ggga(X, Z, U, quot_in_ggga(X, Z, Z, P))
quot_in_ggga(s(X), Y, Z, U) → U6_ggga(X, Y, Z, U, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U6_ggga(X, Y, Z, U, p_out_ga(Y, P)) → U7_ggga(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U7_ggga(X, Y, Z, U, quot_out_ggga(X, P, Z, U)) → quot_out_ggga(s(X), Y, Z, U)
U5_ggga(X, Z, U, quot_out_ggga(X, Z, Z, P)) → quot_out_ggga(X, 0, Z, U)
U1_gga(X, Y, Z, quot_out_ggga(X, Y, Y, Z)) → div_out_gga(X, Y, Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
quot_in_ggga(x1, x2, x3, x4)  =  quot_in_ggga(x1, x2, x3)
0  =  0
s(x1)  =  s(x1)
U2_ggga(x1, x2, x3, x4)  =  U2_ggga(x1, x2, x4)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
quot_out_ggga(x1, x2, x3, x4)  =  quot_out_ggga(x1, x2, x3)
U3_ggga(x1, x2, x3, x4)  =  U3_ggga(x1, x2, x4)
eq_in_ga(x1, x2)  =  eq_in_ga(x1)
eq_out_ga(x1, x2)  =  eq_out_ga(x1, x2)
U4_ggga(x1, x2, x3, x4)  =  U4_ggga(x1, x2, x4)
p_in_aa(x1, x2)  =  p_in_aa
p_out_aa(x1, x2)  =  p_out_aa
U5_ggga(x1, x2, x3, x4)  =  U5_ggga(x1, x2, x4)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U7_ggga(x1, x2, x3, x4, x5)  =  U7_ggga(x1, x2, x3, x5)
div_out_gga(x1, x2, x3)  =  div_out_gga(x1, x2)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

DIV_IN_GGA(X, Y, Z) → U1_GGA(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
DIV_IN_GGA(X, Y, Z) → QUOT_IN_GGGA(X, Y, Y, Z)
QUOT_IN_GGGA(0, s(Y), s(Z), R) → U2_GGGA(Y, Z, R, eq_in_ag(R, 0))
QUOT_IN_GGGA(0, s(Y), s(Z), R) → EQ_IN_AG(R, 0)
QUOT_IN_GGGA(X, 0, Z, U) → U3_GGGA(X, Z, U, eq_in_ga(Z, s(X1)))
QUOT_IN_GGGA(X, 0, Z, U) → EQ_IN_GA(Z, s(X1))
U3_GGGA(X, Z, U, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, U, p_in_aa(U, P))
U3_GGGA(X, Z, U, eq_out_ga(Z, s(X1))) → P_IN_AA(U, P)
U4_GGGA(X, Z, U, p_out_aa(U, P)) → U5_GGGA(X, Z, U, quot_in_ggga(X, Z, Z, P))
U4_GGGA(X, Z, U, p_out_aa(U, P)) → QUOT_IN_GGGA(X, Z, Z, P)
QUOT_IN_GGGA(s(X), Y, Z, U) → U6_GGGA(X, Y, Z, U, p_in_ga(Y, P))
QUOT_IN_GGGA(s(X), Y, Z, U) → P_IN_GA(Y, P)
U6_GGGA(X, Y, Z, U, p_out_ga(Y, P)) → U7_GGGA(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U6_GGGA(X, Y, Z, U, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z, U)

The TRS R consists of the following rules:

div_in_gga(X, Y, Z) → U1_gga(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
quot_in_ggga(0, s(Y), s(Z), R) → U2_ggga(Y, Z, R, eq_in_ag(R, 0))
eq_in_ag(X, X) → eq_out_ag(X, X)
U2_ggga(Y, Z, R, eq_out_ag(R, 0)) → quot_out_ggga(0, s(Y), s(Z), R)
quot_in_ggga(X, 0, Z, U) → U3_ggga(X, Z, U, eq_in_ga(Z, s(X1)))
eq_in_ga(X, X) → eq_out_ga(X, X)
U3_ggga(X, Z, U, eq_out_ga(Z, s(X1))) → U4_ggga(X, Z, U, p_in_aa(U, P))
p_in_aa(0, 0) → p_out_aa(0, 0)
p_in_aa(s(X), X) → p_out_aa(s(X), X)
U4_ggga(X, Z, U, p_out_aa(U, P)) → U5_ggga(X, Z, U, quot_in_ggga(X, Z, Z, P))
quot_in_ggga(s(X), Y, Z, U) → U6_ggga(X, Y, Z, U, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U6_ggga(X, Y, Z, U, p_out_ga(Y, P)) → U7_ggga(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U7_ggga(X, Y, Z, U, quot_out_ggga(X, P, Z, U)) → quot_out_ggga(s(X), Y, Z, U)
U5_ggga(X, Z, U, quot_out_ggga(X, Z, Z, P)) → quot_out_ggga(X, 0, Z, U)
U1_gga(X, Y, Z, quot_out_ggga(X, Y, Y, Z)) → div_out_gga(X, Y, Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
quot_in_ggga(x1, x2, x3, x4)  =  quot_in_ggga(x1, x2, x3)
0  =  0
s(x1)  =  s(x1)
U2_ggga(x1, x2, x3, x4)  =  U2_ggga(x1, x2, x4)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
quot_out_ggga(x1, x2, x3, x4)  =  quot_out_ggga(x1, x2, x3)
U3_ggga(x1, x2, x3, x4)  =  U3_ggga(x1, x2, x4)
eq_in_ga(x1, x2)  =  eq_in_ga(x1)
eq_out_ga(x1, x2)  =  eq_out_ga(x1, x2)
U4_ggga(x1, x2, x3, x4)  =  U4_ggga(x1, x2, x4)
p_in_aa(x1, x2)  =  p_in_aa
p_out_aa(x1, x2)  =  p_out_aa
U5_ggga(x1, x2, x3, x4)  =  U5_ggga(x1, x2, x4)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U7_ggga(x1, x2, x3, x4, x5)  =  U7_ggga(x1, x2, x3, x5)
div_out_gga(x1, x2, x3)  =  div_out_gga(x1, x2)
DIV_IN_GGA(x1, x2, x3)  =  DIV_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
QUOT_IN_GGGA(x1, x2, x3, x4)  =  QUOT_IN_GGGA(x1, x2, x3)
U2_GGGA(x1, x2, x3, x4)  =  U2_GGGA(x1, x2, x4)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U3_GGGA(x1, x2, x3, x4)  =  U3_GGGA(x1, x2, x4)
EQ_IN_GA(x1, x2)  =  EQ_IN_GA(x1)
U4_GGGA(x1, x2, x3, x4)  =  U4_GGGA(x1, x2, x4)
P_IN_AA(x1, x2)  =  P_IN_AA
U5_GGGA(x1, x2, x3, x4)  =  U5_GGGA(x1, x2, x4)
U6_GGGA(x1, x2, x3, x4, x5)  =  U6_GGGA(x1, x2, x3, x5)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U7_GGGA(x1, x2, x3, x4, x5)  =  U7_GGGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

DIV_IN_GGA(X, Y, Z) → U1_GGA(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
DIV_IN_GGA(X, Y, Z) → QUOT_IN_GGGA(X, Y, Y, Z)
QUOT_IN_GGGA(0, s(Y), s(Z), R) → U2_GGGA(Y, Z, R, eq_in_ag(R, 0))
QUOT_IN_GGGA(0, s(Y), s(Z), R) → EQ_IN_AG(R, 0)
QUOT_IN_GGGA(X, 0, Z, U) → U3_GGGA(X, Z, U, eq_in_ga(Z, s(X1)))
QUOT_IN_GGGA(X, 0, Z, U) → EQ_IN_GA(Z, s(X1))
U3_GGGA(X, Z, U, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, U, p_in_aa(U, P))
U3_GGGA(X, Z, U, eq_out_ga(Z, s(X1))) → P_IN_AA(U, P)
U4_GGGA(X, Z, U, p_out_aa(U, P)) → U5_GGGA(X, Z, U, quot_in_ggga(X, Z, Z, P))
U4_GGGA(X, Z, U, p_out_aa(U, P)) → QUOT_IN_GGGA(X, Z, Z, P)
QUOT_IN_GGGA(s(X), Y, Z, U) → U6_GGGA(X, Y, Z, U, p_in_ga(Y, P))
QUOT_IN_GGGA(s(X), Y, Z, U) → P_IN_GA(Y, P)
U6_GGGA(X, Y, Z, U, p_out_ga(Y, P)) → U7_GGGA(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U6_GGGA(X, Y, Z, U, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z, U)

The TRS R consists of the following rules:

div_in_gga(X, Y, Z) → U1_gga(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
quot_in_ggga(0, s(Y), s(Z), R) → U2_ggga(Y, Z, R, eq_in_ag(R, 0))
eq_in_ag(X, X) → eq_out_ag(X, X)
U2_ggga(Y, Z, R, eq_out_ag(R, 0)) → quot_out_ggga(0, s(Y), s(Z), R)
quot_in_ggga(X, 0, Z, U) → U3_ggga(X, Z, U, eq_in_ga(Z, s(X1)))
eq_in_ga(X, X) → eq_out_ga(X, X)
U3_ggga(X, Z, U, eq_out_ga(Z, s(X1))) → U4_ggga(X, Z, U, p_in_aa(U, P))
p_in_aa(0, 0) → p_out_aa(0, 0)
p_in_aa(s(X), X) → p_out_aa(s(X), X)
U4_ggga(X, Z, U, p_out_aa(U, P)) → U5_ggga(X, Z, U, quot_in_ggga(X, Z, Z, P))
quot_in_ggga(s(X), Y, Z, U) → U6_ggga(X, Y, Z, U, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U6_ggga(X, Y, Z, U, p_out_ga(Y, P)) → U7_ggga(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U7_ggga(X, Y, Z, U, quot_out_ggga(X, P, Z, U)) → quot_out_ggga(s(X), Y, Z, U)
U5_ggga(X, Z, U, quot_out_ggga(X, Z, Z, P)) → quot_out_ggga(X, 0, Z, U)
U1_gga(X, Y, Z, quot_out_ggga(X, Y, Y, Z)) → div_out_gga(X, Y, Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
quot_in_ggga(x1, x2, x3, x4)  =  quot_in_ggga(x1, x2, x3)
0  =  0
s(x1)  =  s(x1)
U2_ggga(x1, x2, x3, x4)  =  U2_ggga(x1, x2, x4)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
quot_out_ggga(x1, x2, x3, x4)  =  quot_out_ggga(x1, x2, x3)
U3_ggga(x1, x2, x3, x4)  =  U3_ggga(x1, x2, x4)
eq_in_ga(x1, x2)  =  eq_in_ga(x1)
eq_out_ga(x1, x2)  =  eq_out_ga(x1, x2)
U4_ggga(x1, x2, x3, x4)  =  U4_ggga(x1, x2, x4)
p_in_aa(x1, x2)  =  p_in_aa
p_out_aa(x1, x2)  =  p_out_aa
U5_ggga(x1, x2, x3, x4)  =  U5_ggga(x1, x2, x4)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U7_ggga(x1, x2, x3, x4, x5)  =  U7_ggga(x1, x2, x3, x5)
div_out_gga(x1, x2, x3)  =  div_out_gga(x1, x2)
DIV_IN_GGA(x1, x2, x3)  =  DIV_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
QUOT_IN_GGGA(x1, x2, x3, x4)  =  QUOT_IN_GGGA(x1, x2, x3)
U2_GGGA(x1, x2, x3, x4)  =  U2_GGGA(x1, x2, x4)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U3_GGGA(x1, x2, x3, x4)  =  U3_GGGA(x1, x2, x4)
EQ_IN_GA(x1, x2)  =  EQ_IN_GA(x1)
U4_GGGA(x1, x2, x3, x4)  =  U4_GGGA(x1, x2, x4)
P_IN_AA(x1, x2)  =  P_IN_AA
U5_GGGA(x1, x2, x3, x4)  =  U5_GGGA(x1, x2, x4)
U6_GGGA(x1, x2, x3, x4, x5)  =  U6_GGGA(x1, x2, x3, x5)
P_IN_GA(x1, x2)  =  P_IN_GA(x1)
U7_GGGA(x1, x2, x3, x4, x5)  =  U7_GGGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 9 less nodes.

(8) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

QUOT_IN_GGGA(X, 0, Z, U) → U3_GGGA(X, Z, U, eq_in_ga(Z, s(X1)))
U3_GGGA(X, Z, U, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, U, p_in_aa(U, P))
U4_GGGA(X, Z, U, p_out_aa(U, P)) → QUOT_IN_GGGA(X, Z, Z, P)
QUOT_IN_GGGA(s(X), Y, Z, U) → U6_GGGA(X, Y, Z, U, p_in_ga(Y, P))
U6_GGGA(X, Y, Z, U, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z, U)

The TRS R consists of the following rules:

div_in_gga(X, Y, Z) → U1_gga(X, Y, Z, quot_in_ggga(X, Y, Y, Z))
quot_in_ggga(0, s(Y), s(Z), R) → U2_ggga(Y, Z, R, eq_in_ag(R, 0))
eq_in_ag(X, X) → eq_out_ag(X, X)
U2_ggga(Y, Z, R, eq_out_ag(R, 0)) → quot_out_ggga(0, s(Y), s(Z), R)
quot_in_ggga(X, 0, Z, U) → U3_ggga(X, Z, U, eq_in_ga(Z, s(X1)))
eq_in_ga(X, X) → eq_out_ga(X, X)
U3_ggga(X, Z, U, eq_out_ga(Z, s(X1))) → U4_ggga(X, Z, U, p_in_aa(U, P))
p_in_aa(0, 0) → p_out_aa(0, 0)
p_in_aa(s(X), X) → p_out_aa(s(X), X)
U4_ggga(X, Z, U, p_out_aa(U, P)) → U5_ggga(X, Z, U, quot_in_ggga(X, Z, Z, P))
quot_in_ggga(s(X), Y, Z, U) → U6_ggga(X, Y, Z, U, p_in_ga(Y, P))
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)
U6_ggga(X, Y, Z, U, p_out_ga(Y, P)) → U7_ggga(X, Y, Z, U, quot_in_ggga(X, P, Z, U))
U7_ggga(X, Y, Z, U, quot_out_ggga(X, P, Z, U)) → quot_out_ggga(s(X), Y, Z, U)
U5_ggga(X, Z, U, quot_out_ggga(X, Z, Z, P)) → quot_out_ggga(X, 0, Z, U)
U1_gga(X, Y, Z, quot_out_ggga(X, Y, Y, Z)) → div_out_gga(X, Y, Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x1, x2, x4)
quot_in_ggga(x1, x2, x3, x4)  =  quot_in_ggga(x1, x2, x3)
0  =  0
s(x1)  =  s(x1)
U2_ggga(x1, x2, x3, x4)  =  U2_ggga(x1, x2, x4)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
quot_out_ggga(x1, x2, x3, x4)  =  quot_out_ggga(x1, x2, x3)
U3_ggga(x1, x2, x3, x4)  =  U3_ggga(x1, x2, x4)
eq_in_ga(x1, x2)  =  eq_in_ga(x1)
eq_out_ga(x1, x2)  =  eq_out_ga(x1, x2)
U4_ggga(x1, x2, x3, x4)  =  U4_ggga(x1, x2, x4)
p_in_aa(x1, x2)  =  p_in_aa
p_out_aa(x1, x2)  =  p_out_aa
U5_ggga(x1, x2, x3, x4)  =  U5_ggga(x1, x2, x4)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
U7_ggga(x1, x2, x3, x4, x5)  =  U7_ggga(x1, x2, x3, x5)
div_out_gga(x1, x2, x3)  =  div_out_gga(x1, x2)
QUOT_IN_GGGA(x1, x2, x3, x4)  =  QUOT_IN_GGGA(x1, x2, x3)
U3_GGGA(x1, x2, x3, x4)  =  U3_GGGA(x1, x2, x4)
U4_GGGA(x1, x2, x3, x4)  =  U4_GGGA(x1, x2, x4)
U6_GGGA(x1, x2, x3, x4, x5)  =  U6_GGGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(9) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(10) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

QUOT_IN_GGGA(X, 0, Z, U) → U3_GGGA(X, Z, U, eq_in_ga(Z, s(X1)))
U3_GGGA(X, Z, U, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, U, p_in_aa(U, P))
U4_GGGA(X, Z, U, p_out_aa(U, P)) → QUOT_IN_GGGA(X, Z, Z, P)
QUOT_IN_GGGA(s(X), Y, Z, U) → U6_GGGA(X, Y, Z, U, p_in_ga(Y, P))
U6_GGGA(X, Y, Z, U, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z, U)

The TRS R consists of the following rules:

eq_in_ga(X, X) → eq_out_ga(X, X)
p_in_aa(0, 0) → p_out_aa(0, 0)
p_in_aa(s(X), X) → p_out_aa(s(X), X)
p_in_ga(0, 0) → p_out_ga(0, 0)
p_in_ga(s(X), X) → p_out_ga(s(X), X)

The argument filtering Pi contains the following mapping:
0  =  0
s(x1)  =  s(x1)
eq_in_ga(x1, x2)  =  eq_in_ga(x1)
eq_out_ga(x1, x2)  =  eq_out_ga(x1, x2)
p_in_aa(x1, x2)  =  p_in_aa
p_out_aa(x1, x2)  =  p_out_aa
p_in_ga(x1, x2)  =  p_in_ga(x1)
p_out_ga(x1, x2)  =  p_out_ga(x1, x2)
QUOT_IN_GGGA(x1, x2, x3, x4)  =  QUOT_IN_GGGA(x1, x2, x3)
U3_GGGA(x1, x2, x3, x4)  =  U3_GGGA(x1, x2, x4)
U4_GGGA(x1, x2, x3, x4)  =  U4_GGGA(x1, x2, x4)
U6_GGGA(x1, x2, x3, x4, x5)  =  U6_GGGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(11) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_in_ga(Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_in_aa)
U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)

The TRS R consists of the following rules:

eq_in_ga(X) → eq_out_ga(X, X)
p_in_aap_out_aa
p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

eq_in_ga(x0)
p_in_aa
p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(13) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_in_ga(Z)) at position [2] we obtained the following new rules [LPAR04]:

QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_in_aa)
U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))

The TRS R consists of the following rules:

eq_in_ga(X) → eq_out_ga(X, X)
p_in_aap_out_aa
p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

eq_in_ga(x0)
p_in_aa
p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(15) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_in_aa)
U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_aap_out_aa

The set Q consists of the following terms:

eq_in_ga(x0)
p_in_aa
p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(17) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

eq_in_ga(x0)

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_in_aa)
U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_aap_out_aa

The set Q consists of the following terms:

p_in_aa
p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(19) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_in_aa) at position [2] we obtained the following new rules [LPAR04]:

U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)
p_in_aap_out_aa

The set Q consists of the following terms:

p_in_aa
p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(21) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

p_in_aa
p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(23) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

p_in_aa

(24) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y))
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(25) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule QUOT_IN_GGGA(s(X), Y, Z) → U6_GGGA(X, Y, Z, p_in_ga(Y)) at position [3] we obtained the following new rules [LPAR04]:

QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))

(26) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)
QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))

The TRS R consists of the following rules:

p_in_ga(0) → p_out_ga(0, 0)
p_in_ga(s(X)) → p_out_ga(s(X), X)

The set Q consists of the following terms:

p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(27) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(28) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)
QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))

R is empty.
The set Q consists of the following terms:

p_in_ga(x0)

We have to consider all (P,Q,R)-chains.

(29) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

p_in_ga(x0)

(30) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)
QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(31) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U6_GGGA(X, Y, Z, p_out_ga(Y, P)) → QUOT_IN_GGGA(X, P, Z) we obtained the following new rules [LPAR04]:

U6_GGGA(z0, 0, z1, p_out_ga(0, 0)) → QUOT_IN_GGGA(z0, 0, z1)
U6_GGGA(z0, s(z1), z2, p_out_ga(s(z1), z1)) → QUOT_IN_GGGA(z0, z1, z2)

(32) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa)
QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))
U6_GGGA(z0, 0, z1, p_out_ga(0, 0)) → QUOT_IN_GGGA(z0, 0, z1)
U6_GGGA(z0, s(z1), z2, p_out_ga(s(z1), z1)) → QUOT_IN_GGGA(z0, z1, z2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(33) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U3_GGGA(X, Z, eq_out_ga(Z, s(X1))) → U4_GGGA(X, Z, p_out_aa) we obtained the following new rules [LPAR04]:

U3_GGGA(z0, s(x2), eq_out_ga(s(x2), s(x2))) → U4_GGGA(z0, s(x2), p_out_aa)

(34) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))
U6_GGGA(z0, 0, z1, p_out_ga(0, 0)) → QUOT_IN_GGGA(z0, 0, z1)
U6_GGGA(z0, s(z1), z2, p_out_ga(s(z1), z1)) → QUOT_IN_GGGA(z0, z1, z2)
U3_GGGA(z0, s(x2), eq_out_ga(s(x2), s(x2))) → U4_GGGA(z0, s(x2), p_out_aa)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(35) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


QUOT_IN_GGGA(s(y0), 0, y2) → U6_GGGA(y0, 0, y2, p_out_ga(0, 0))
QUOT_IN_GGGA(s(y0), s(x0), y2) → U6_GGGA(y0, s(x0), y2, p_out_ga(s(x0), x0))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(QUOT_IN_GGGA(x1, x2, x3)) = x1   
POL(U3_GGGA(x1, x2, x3)) = x1   
POL(U4_GGGA(x1, x2, x3)) = x1   
POL(U6_GGGA(x1, x2, x3, x4)) = x1   
POL(eq_out_ga(x1, x2)) = 0   
POL(p_out_aa) = 0   
POL(p_out_ga(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
none

(36) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U6_GGGA(z0, 0, z1, p_out_ga(0, 0)) → QUOT_IN_GGGA(z0, 0, z1)
U6_GGGA(z0, s(z1), z2, p_out_ga(s(z1), z1)) → QUOT_IN_GGGA(z0, z1, z2)
U3_GGGA(z0, s(x2), eq_out_ga(s(x2), s(x2))) → U4_GGGA(z0, s(x2), p_out_aa)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(37) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.

(38) Obligation:

Q DP problem:
The TRS P consists of the following rules:

QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z))
U3_GGGA(z0, s(x2), eq_out_ga(s(x2), s(x2))) → U4_GGGA(z0, s(x2), p_out_aa)
U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(39) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule QUOT_IN_GGGA(X, 0, Z) → U3_GGGA(X, Z, eq_out_ga(Z, Z)) we obtained the following new rules [LPAR04]:

QUOT_IN_GGGA(z0, 0, 0) → U3_GGGA(z0, 0, eq_out_ga(0, 0))

(40) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U3_GGGA(z0, s(x2), eq_out_ga(s(x2), s(x2))) → U4_GGGA(z0, s(x2), p_out_aa)
U4_GGGA(X, Z, p_out_aa) → QUOT_IN_GGGA(X, Z, Z)
QUOT_IN_GGGA(z0, 0, 0) → U3_GGGA(z0, 0, eq_out_ga(0, 0))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(41) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 3 less nodes.

(42) TRUE